﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DanhMucLinhVuc.ascx.cs" Inherits="QuanLyDeTaiKHCN.UserControls.DanhMucLinhVuc" %>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="udt1" runat="server">
    <ContentTemplate>
        <div style="float:left;width:40%;">
            <div class="control-group info">
                <label class="control-label" style="padding-right: 10px;">Nhập tên danh mục</label>
                <div class="controls">
                    <asp:TextBox ID="txtTenLinhVuc" AutoPostBack="true" OnTextChanged="btnsave_Click" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;"></label>
                <div class="controls">
                    <asp:LinkButton ID="btnsave" OnClick="btnsave_Click" class="btn btn-primary" runat="server"><i class=" icon-save"></i>&nbsp;&nbsp;Lưu</asp:LinkButton>
                    <asp:Label ID="lblstatus" runat="server" ForeColor="Red"></asp:Label>
                </div>
            </div>
        </div>
        <div style="float:left;width:59%;">
            <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" ForeColor="#333333" GridLines="None" OnRowDeleting="grid_RowDeleting" OnRowCancelingEdit="grid_RowCancelingEdit" OnRowEditing="grid_RowEditing" OnRowUpdating="grid_RowUpdating">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="Tên Danh Mục">
                        <ItemTemplate>
                            <asp:Label ID="lblTenLinhVuc" runat="server" Text='<%# Bind("TenLinhVuc") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtTenLinhVuc" runat="server" Text='<%# Bind("TenLinhVuc") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="true" HeaderText="Cập nhật">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="<i class='icon-save'></i> Lưu"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="<i class='icon-off'></i> Hủy"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Edit" Text="<i class='icon-edit'></i> Sửa"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="true" HeaderText="Xóa">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" OnClientClick="return confirm('Có chắc xóa không!')" CommandName="Delete" Text="<i class='icon-remove red'></i> Xóa"></asp:LinkButton>
                        </ItemTemplate>
                        <EditItemTemplate>

                        </EditItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
<%--                <EditRowStyle BackColor="#2461BF" />--%>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>